import { instance } from "../utils/request";
const getSuppliersPagination = async (page:number,limit:number,key?:string) => {
	return await instance.get("/Suppliers/Pagination", {page,limit,key});
};

const addSuppliers = async (data:RequestCreateSuppliersDto) => {
	return await instance.post("/Suppliers/Add", data);
};

const updateSuppliers = async (data:RequestUpdateSuppliersDto) => {
	return await instance.post("/Suppliers/Update", data);
};

const getSuppliersDetail = async (id:number) => {
	return await instance.get("/Suppliers/Detail", { id  });
};

const deleteSuppliers = async (data:RequestIdSuppliersDto) => {
	return await instance.post("/Suppliers/Delete", data);
};

const SuppliersApi = {
	getSuppliersPagination,
	addSuppliers,
	updateSuppliers,
	getSuppliersDetail,
	deleteSuppliers,
};

export default SuppliersApi
